from die import Die
import plotly.express as px

die = Die()
results = []
for roll_num in range(100):
    result = die.roll()
    results.append(result)

print(results)

# 开始分析结果

frequencies = []
poss_results = range(1,die.num_sides+1)
for v in poss_results:
    frequency = results.count(v)
    frequencies.append(frequency)

print(frequencies)

title = "胡绍康"
labels = {'x' : 'Result','y':'Frequency of Result'}
fig = px.bar(x = poss_results,y = frequencies,title = title , labels =labels)
fig.show()